 <template>
  <div class="address_page">
    <head-top head-title="添加建议" go-back="true"></head-top>
    <section class="page_text_container">
      <section class="section_list">
        <span class="section_left">标题</span>
        <section class="section_right">
          <input type="text" name="ctitle" placeholder="输入标题" v-model="ctitle" class="input_style" />
        </section>
      </section>
      <section class="section_list">
        <span class="section_left">内容</span>
        <section class="section_right">
          <div class="phone_add">
            <input type="text" name="ctext" placeholder="输入内容" v-model="ctext" class="input_style" />
          </div>
        </section>
      </section>
      <section class="section_list">
        <span class="section_left">地址</span>
        <section class="section_right">
          <div class="phone_add">
            <input
              type="text"
              name="caddress"
              placeholder="输入地址"
              v-model="caddress"
              class="input_style"
            />
          </div>
        </section>
      </section>
    </section>
    <div class="determine" @click="addSuggest">确定</div>
         <div class="determine1" @click="quit">取消</div>

    <transition name="router-slid" mode="out-in">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
import headTop from "src/components/header/head";

export default {
  data() {
    return {
     
      ctitle: '', //标题
      ctext: '', //内容
      caddress: '' //地址
    };
  },
  created() {},
  components: {
    headTop
  },
  computed: {},
  methods: {
      
    addSuggest() {
        console.log(this.ctitle)
      this.axios.get("http://172.16.9.15:8082/complaint/addSuggest",{
        params: { 
          createPerson: sessionStorage.getItem("userId"),
            title: this.ctitle, 
            content: this.ctext, 
            area: this.caddress }
      }).then(function(res) {});
        this.$router.push("/complaint");
    },
    quit(){
         this.$router.push("/complaint");
    }
  }
};
</script>

<style lang="scss" scoped>
@import "src/style/mixin";

.address_page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #f5f5f5;
  z-index: 204;
  padding-top: 1.95rem;
  p,
  span,
  input {
    font-family: Helvetica Neue, Tahoma, Arial;
  }
}
.page_text_container {
  background-color: #fff;
  padding: 0 0.7rem;
}
.section_list {
  display: flex;
  border-bottom: 0.025rem solid #f5f5f5;
  .section_left {
    @include sc(0.7rem, #333);
    flex: 2;
    line-height: 2.5rem;
  }
  .section_right {
    flex: 5;
    .input_style {
      width: 100%;
      height: 2.5rem;
      @include sc(0.7rem, #999);
    }

    .phone_add {
      @include fj;
      align-items: center;
    }
    .choose_sex {
      display: flex;
      line-height: 2.5rem;
      border-top: 0.025rem solid #f5f5f5;
      .choose_option {
        @include sc(0.7rem, #333);
        display: flex;
        align-items: center;
        margin-right: 0.8rem;
        svg {
          margin-right: 0.3rem;
          @include wh(0.8rem, 0.8rem);
          fill: #ccc;
        }
        .choosed {
          fill: #4cd964;
        }
      }
    }
    .choose_address {
      @include sc(0.7rem, #999);
      line-height: 2.5rem;
      border-bottom: 0.025rem solid #f5f5f5;
    }
  }
}
.determine {
  background-color: #4cd964;
  @include sc(0.7rem, #fff);
  text-align: center;
  margin: 0 0.7rem;
  line-height: 1.8rem;
  border-radius: 0.2rem;
  margin-top: 0.6rem;
}
.determine1 {
  background-color: #f34141;
  @include sc(0.7rem, #fff);
  text-align: center;
  margin: 0 0.7rem;
  line-height: 1.8rem;
  border-radius: 0.2rem;
  margin-top: 0.6rem;
}
.router-slid-enter-active,
.router-slid-leave-active {
  transition: all 0.4s;
}
.router-slid-enter,
.router-slid-leave-active {
  transform: translate3d(2rem, 0, 0);
  opacity: 0;
}
</style>
